package com.itheima.listener;

import com.google.gson.Gson;
import com.itheima.config.ApplicationContextHandler;
import com.itheima.service.ActivitiService;
import org.activiti.engine.delegate.DelegateTask;
import org.activiti.engine.delegate.TaskListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.io.Serializable;
@Service("taskListenerDemo")

public class TaskListenerDemo implements Serializable,TaskListener{


    @Override
    public void notify(DelegateTask delegateTask) {



        Gson gson=new Gson();
        ActivitiService bean = ApplicationContextHandler.getBean(ActivitiService.class);
        bean.atService();

        System.out.println("流程已经完成");

    }
}
